<template>
  <div class="base-container" id="main">
    <t-sticky-tool
      :style="{ position: 'fixed', overflow: 'hidden',zIndex: 1000 }"
      :offset="[-60, 100]"
      @click="handlerOpenDetail"
    >
<!--      <t-sticky-item  label="评审记录" >-->
<!--        <template #icon>-->
<!--          <t-icon name="file-paste"></t-icon>-->
<!--        </template>-->
<!--      </t-sticky-item>-->
      <t-sticky-item   label="申报详情" >
        <template #icon>
          <t-icon name="file-paste"></t-icon>
        </template>
      </t-sticky-item>
    </t-sticky-tool>
    <project-detail-dialog :header="dialog.header" :objId="dialog.objId" :visible.sync="dialog.open_project_detail"
                           v-if="dialog.open_project_detail"></project-detail-dialog>
    <approve-list tab-default-value="2" :header="dialog.header" :objId="dialog.objId" :visible.sync="dialog.open_approve_list"
                  v-if="dialog.open_approve_list"></approve-list>

    <t-loading text="加载中..." :fullscreen="false" attach="#main" :loading="applyLoading" size="medium">
    </t-loading>
    <t-message theme="warning" v-if="(startDate!=='' || endDate!=='') && isOldProject!=='1'" style="width: 100%;margin-bottom: 10px;display: flex;gap: 10px"><div v-if="startDate">编制开始时间：{{startDate}}</div><div  v-if="endDate">编制截止时间：{{endDate}}</div></t-message>
    <t-steps  :current="activeForm" status="process" :onChange="onCurChanged">
      <t-step-item title="基本信息" :content="isSubmit('outlineId')">
      </t-step-item>
      <t-step-item title="前期研究及工作基础" :content="isSubmit('basicstudyId')"></t-step-item>
      <t-step-item title="研究、开发的背景、必要性" :content="isSubmit('backgroundId')"></t-step-item>
      <t-step-item title="研究、开发实施方案" :content="isSubmit('approachId')"></t-step-item>
      <t-step-item title="考核目标和技术经济指标" :content="isSubmit('goalId')"></t-step-item>
      <t-step-item title="单位信息" :content="isSubmit('companyId')"></t-step-item>
      <t-step-item title="研究人员" :content="isSubmit('memberId')"></t-step-item>
      <t-step-item title="经费预算" :content="isSubmit('budgetId')"></t-step-item>
      <t-step-item title="经济效益和社会效益评估" :content="isSubmit('benefitId')"></t-step-item>
      <t-step-item title="其他需要说明的问题" :content="isSubmit('otherId')"></t-step-item>
      <t-step-item title="按专家评审意见修改说明" :content="isSubmit('reviewId')"></t-step-item>
      <!-- <t-step-item title="附件信息" :content="isSubmit('fileId')"></t-step-item> -->
    </t-steps>
    <!-- 基本信息 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 0" labelAlign="top" class="step-form" :data="formData0"
            :rules="isOldProject==='1'?rules00:rules0"
            labelWidth="180px">
      <t-alert v-if="site_tag === 'jtt'" style="margin-bottom: 14px" theme="info" title="填报说明：">
        <div slot="message">
          <p class="span-txt">
            一、科技项目研究工作大纲是指导项目实施的纲领性文件，申报单位应在深入调研和充分论证的基础上，理清研究思路、界定研究范围、明确研究重点，按照《江西省交通运输厅科技项目管理办法》中有关规定与要求编写研究工作大纲，并及时提交评审。
          </p>
          <p class="span-txt">二、格式要求</p>
          <p class="span-txt">纸张规格：A4，竖装</p>
          <p class="span-txt">标题字：四号黑体</p>
          <p class="span-txt">内容字：小四号宋体，1.5倍的行距</p>
          <p class="span-txt">三、编制框架要求</p>
          <p class="span-txt">（一）项目概要；</p>
          <p class="span-txt">（二）项目前期研究及工作基础（包括国内外同类技术研究现状分析及评价，应附主要参考文献及出处）；</p>
          <p class="span-txt">（三）项目研究、开发的背景、必要性（包括项目研究目的，市场需求前景或推广应用领域，达到的技术水平及在国民经济发展中的作用等）；</p>
          <p class="span-txt">（四）项目研究、开发实施方案（包括拟解决的关键问题，实施的具体内容及实施方案，拟采取的技术路线等）；</p>
          <p class="span-txt">（五）考核目标和技术经济指标（包括项目的具体考核目标，有关技术经济指标等）；</p>
          <p class="span-txt">（六）项目研究开发进度（包括年度工作计划安排，项目完成期限）；</p>
          <p class="span-txt">（七）项目承担单位及合作单位概况（包括单位概况，投资来源，单位研究开发基础及能力，项目主要负责人简介等）；</p>
          <p class="span-txt">（八）项目经费预算（参照《江西省交通运输厅科技项目申报书》中“经费预算”样式填写）；</p>
          <p class="span-txt">（九）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）；</p>
          <p class="span-txt">（十）其它需要说明的问题（软科学类研究项目要列明预期成果报告的章节）；</p>
          <p class="span-txt">（十一）项目人员组成（参照《江西省交通运输厅科技项目申报书》中“研究人员”表格样式填写）；</p>
          <p class="span-txt">（十二）项目承担单位意见（包括单位负责人签字，单位公章）。</p>
          <p class="span-txt">四、省交通运输厅对具备评审要求的研究工作大纲，将组织相关专业的专家进行大纲评审。并依据评审结果，确定科技项目任务书（合同）。</p>
        </div>
      </t-alert>
      <t-alert v-else style="margin-bottom: 14px" theme="info" title="填报说明：">
        <div slot="message">
          <p class="span-txt">
            一、科技项目研究工作大纲是指导项目实施的纲领性文件，承担单位应在深入调研和充分论证的基础上，理清研究思路、界定研究范围、明确研究重点，按照《江西省交通投资集团有限责任公司科技创新管理办法》有关规定与要求编写研究工作大纲，纸质材料（一式2份）报送至集团科技信息部，电子版一并报送。 </p>
          <p class="span-txt">二、格式要求</p>
          <p class="span-txt">纸张规格：A4，竖装</p>
          <p class="span-txt">标题字：四号黑体</p>
          <p class="span-txt">内容字：小四号宋体，1.5倍的行距</p>
          <p class="span-txt">三、编制框架要求</p>
          <p class="span-txt">（一）项目概要；</p>
          <p class="span-txt">（二）项目前期研究及工作基础（包括国内外同类技术研究现状分析及评价，应附主要参考文献及出处）；</p>
          <p class="span-txt">（三）项目研究、开发的背景、必要性（包括项目研究目的，市场需求前景或推广应用领域，达到的技术水平及在国民经济发展中的作用等）；</p>
          <p class="span-txt">（四）项目研究、开发实施方案（包括拟解决的关键问题，实施的具体内容及实施方案，拟采取的技术路线等）；</p>
          <p class="span-txt">（五）考核目标和技术经济指标（包括项目的具体考核目标，有关技术经济指标等）；</p>
          <p class="span-txt">（六）项目研究开发进度（包括年度工作计划安排，项目完成期限）；</p>
          <p class="span-txt">（七）项目承担单位及合作单位概况（包括单位概况，投资来源，单位研究开发基础及能力，项目主要负责人简介等）；</p>
          <p class="span-txt">（八）项目经费预算（参照《江西省交通投资集团有限责任公司科技项目建议书》中“经费预算”样式填写）；</p>
          <p class="span-txt">（九）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）；</p>
          <p class="span-txt">（十）其它需要说明的问题（软科学类研究项目要列明预期成果报告的章节）；</p>
          <p class="span-txt">（十一）项目人员组成（参照《江西省交通投资集团有限责任公司科技项目建议书》中“研究人员”表格样式填写）；</p>
          <p class="span-txt">（十二）项目承担单位意见（包括意见内容、单位负责人签字，单位公章）。</p>
          <p class="span-txt">四、集团对具备评审要求的研究工作大纲，将组织相关专业的专家进行大纲评审。并依据评审结果，确定科技项目任务书（合同）。</p>
        </div>
      </t-alert>
      <t-row v-if="isOldProject === '1'" style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="项目编号：" name="projectNum">
                        <t-input clearable style="width: 390px" v-model="formData0.projectNum"></t-input>
          </t-form-item>
        </t-col>
      </t-row>

      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="6">
          <t-form-item label="编制时间：" name="compileDate">
            <t-date-picker v-model="formData0.compileDate"></t-date-picker>
          </t-form-item>
        </t-col>
        <t-col :span="6">
          <t-form-item label="项目名称：" name="projectName">
            <t-input  clearable style="width: 390px" v-model="formData0.projectName"></t-input>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="6">
      <t-form-item label="项目开始时间：" name="startDate">
        <t-date-picker clearable style="width: 390px" v-model="formData0.startDate"></t-date-picker>
      </t-form-item>
        </t-col>
        <t-col :span="6">
          <t-form-item label="项目结束时间：" name="endDate">
            <t-date-picker clearable style="width: 390px" v-model="formData0.endDate"></t-date-picker>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="6">
          <t-form-item label="建议经费总概算：" name="adviceFunding">
            <t-input-adornment append="万元">
              <t-input-number :decimal-places="2"
                              @keyup="()=>{if(formData0.adviceFunding){formData0.adviceFunding=Number((formData0.adviceFunding || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                              :allowInputOverLimit="false" clearable style="width: calc(390px - 45px)"
                              v-model="formData0.adviceFunding"
                              theme="normal"
                              :min="0"></t-input-number>
            </t-input-adornment>
          </t-form-item>
        </t-col>
        <t-col :span="6">
          <t-form-item :label="site_tag==='jtt'?'申请厅补助经费：':'申请集团补助经费：'" name="subsidyFunding">
            <t-input-adornment append="万元">
              <t-input-number :decimal-places="2"
                              @keyup="()=>{if(formData0.subsidyFunding){formData0.subsidyFunding=Number((formData0.subsidyFunding || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                              :allowInputOverLimit="false" clearable style="width: calc(390px - 45px)"
                              v-model="formData0.subsidyFunding"
                              theme="normal"
                              :min="0"></t-input-number>
            </t-input-adornment>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）项目概要：" name="profile">
            <tiny-mce-editor :key="activeForm" :maxlength="site_tag==='jtt'?maxlength:maxlength*3" :textLength.sync="lengthLimitObj.profile"
                             v-model="formData0.profile"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>


      <!--    <t-row style="align-items: stretch" :gutter="14">-->
      <!--      <t-col :span="12">-->
      <!--        <t-form-item label="（十二）项目承担单位意见：" name="preliminaryWork">-->
      <!--          <tiny-mce-editor v-model="formData.implementationPlan"></tiny-mce-editor>-->
      <!--        </t-form-item>-->
      <!--      </t-col>-->
      <!--    </t-row>-->
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button theme="primary" @click="onSubmit0" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 前期研究及工作基础 -->
    <t-form ref="form" v-if="activeForm === 1" labelAlign="top" class="step-form" :data="formData1" :rules="rules1"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）项目前期研究及工作基础（包括国内外同类技术研究现状分析及评价，应附主要参考文献及出处）：" name="preliminaryWork">
          <template #label>
            （一）项目前期研究及工作基础（包括国内外同类技术研究现状分析及评价，应附主要参考文献及出处）：<span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
          </template>
            <tiny-mce-editor :key="activeForm" :maxlength="site_tag==='jtt'?maxlength:maxlength*3" :textLength.sync="lengthLimitObj.preliminaryWork"
                             v-model="formData1.preliminaryWork"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（二）参考文献：" name="literatures">
            <project-background-literature ref="project-background-literature" phaseType="2" :projectId="projectId"
                                           v-model="formData1.literatures"
                                           :editOpen="true"></project-background-literature>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(0)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit1" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 研究、开发的背景、必要性 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 2" labelAlign="top" class="step-form" :data="formData2"
            :rules="rules2"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）项目研究、开发的背景、必要性（包括项目研究目的，市场需求前景或推广应用领域，达到的技术水平及在国民经济发展中的作用等）：" name="necessity">
          <template #label>
            （一）项目研究、开发的背景、必要性（包括项目研究目的，市场需求前景或推广应用领域，达到的技术水平及在国民经济发展中的作用等）：<span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
          </template>
            <tiny-mce-editor :key="activeForm" :maxlength="site_tag==='jtt'?maxlength:maxlength*3" :textLength.sync="lengthLimitObj.necessity"
                             v-model="formData2.necessity"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(1)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit2" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 研究、开发实施方案 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 3" labelAlign="top" class="step-form" :data="formData3"
            :rules="rules3"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）项目研究、开发实施方案（包括拟解决的关键问题，实施的具体内容及实施方案，拟采取的技术路线等）：" name="implementationPlan">
            <template #label>
              （一）项目研究、开发实施方案（包括拟解决的关键问题，实施的具体内容及实施方案，拟采取的技术路线等）：<span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
          </template>
            <tiny-mce-editor :key="activeForm" :maxlength="site_tag==='jtt'?4000:4000*3" :textLength.sync="lengthLimitObj.implementationPlan"
                             v-model="formData3.implementationPlan"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>
<!--      <t-row style="align-items: stretch" :gutter="14">-->
<!--        <t-col :span="12">-->
<!--          <t-form-item :showErrorMessage="false" label="（二）预期研究成果及表达形式："-->
<!--                       name="projectExpectResults">-->
<!--            <template slot="label">（二）预期研究成果及表达形式-->
<!--              <t-alert style="margin-bottom: 14px" theme="info">-->
<!--                <div slot="message">-->
<!--                  <p class="span-txt">-->
<!--                    必须填写一条 成果类型为 研究报告的记录-->
<!--                  </p>-->
<!--                </div>-->
<!--              </t-alert>-->
<!--            </template>-->
<!--            <project-approach-expect-results :projectId="projectId" phaseType="2" ref="project-approach-expect-results"-->
<!--                                             v-model="formData3.projectExpectResults"-->
<!--                                             :editOpen="true"></project-approach-expect-results>-->
<!--            &lt;!&ndash;            <tiny-mce-editor v-model="formData.economicIndex"></tiny-mce-editor>&ndash;&gt;-->
<!--          </t-form-item>-->
<!--        </t-col>-->
<!--      </t-row>-->
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item :show-error-message="false" label="（二）项目研究开发进度（包括年度工作计划安排，项目完成期限）:" name="researchPlans">
            <project-research-plan ref="project-research-plan" v-model="formData3.researchPlans"
                                   :disableDate="disableDate" :projectId="projectId"
                                   :editOpen="true" phaseType="2"></project-research-plan>
          </t-form-item>
        </t-col>
      </t-row>
<!--      <t-row style="align-items: stretch" :gutter="14">-->
<!--        <t-col :span="12">-->
<!--          <t-form-item label="（一）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）：" name="economicBenefits">-->
<!--            <tiny-mce-editor :key="activeForm"  :maxlength="site_tag==='jtt'?maxlength:maxlength*3" :textLength.sync="lengthLimitObj.economicBenefits"-->
<!--                             v-model="formData3.economicBenefits"></tiny-mce-editor>-->
<!--          </t-form-item>-->
<!--        </t-col>-->
<!--      </t-row>-->
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(2)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit3" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 考核目标和技术经济指标 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 4" labelAlign="top" class="step-form" :data="formData4"
            :rules="rules4"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item :showErrorMessage="false" label="（一）考核目标："
                       name="projectExpectResults">
            <template slot="label">（一）考核目标 <span style="color: red">只能增加不能减少请认真填写！</span>
              <t-alert style="margin-bottom: 14px" theme="info">
                <div slot="message">
                  <p class="span-txt">
                    必须填写一条 成果类型为 研究报告的记录
                  </p>
                </div>
              </t-alert>
            </template>
            <project-approach-expect-results :applyOpen="true"  :projectId="projectId" phaseType="2" ref="project-approach-expect-results"
                                             v-model="formData4.projectExpectResults"
                                             :editOpen="true"></project-approach-expect-results>
            <!--            <tiny-mce-editor v-model="formData.economicIndex"></tiny-mce-editor>-->
          </t-form-item>
        </t-col>
      </t-row>
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item :showErrorMessage="false" label="（二）技术经济指标："
                       name="goal">
                       <template #label>
                        （二）技术经济指标：<span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
                      </template>
                        <tiny-mce-editor v-model="formData4.goal"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(3)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit4" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 单位信息 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 5" labelAlign="top" class="step-form" :data="formData5"
            :rules="rules5"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <project-unit ref="project-unit" v-model="formData5.unitList" :adviceFunding="adviceFunding"
                        :projectId="projectId" :editOpen="true"
                        phaseType="2"></project-unit>
        </t-col>
      </t-row>
      <!--      （七）项目承担单位及合作单位概况（包括单位概况，投资来源，单位研究开发基础及能力，项目主要负责人简介等）：-->
      <!--      <t-row style="align-items: stretch" :gutter="14">-->
      <!--        <t-col :span="12">-->
      <!--          <t-form-item label="（七）项目主要负责人简介" name="economicBenefits">-->
      <!--            <tiny-mce-editor :key="activeForm" :textLength.sync="lengthLimitObj.unitOverview"-->
      <!--                             v-model="formData5.unitOverview"></tiny-mce-editor>-->
      <!--          </t-form-item>-->
      <!--        </t-col>-->
      <!--      </t-row>-->
      <t-row>
        <t-col :span="11">
          <t-form-item>
            <t-space size="10px">
              <t-button @click="onCurChanged(4)" theme="primary" variant="base">上一步</t-button>
              <t-button theme="primary" @click="onSubmit5" type="submit">下一步</t-button>
            </t-space>
          </t-form-item>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 研究人员 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 6" labelAlign="top" class="step-form" :data="formData6"
            :rules="rules6"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="" name="memberData">
            <project-member :isOldProject="isOldProject" v-model="formData6.memberList" :projectId="projectId" :editOpen="true"
                            phaseType="2"></project-member>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(5)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit6" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 经费预算 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 7" labelAlign="top" class="step-form" :data="formData7"
            :rules="rules7"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="">
            <project-budget v-model="formData7" :fundingObj="fundingObj" :projectId="projectId" :editOpen="true"
                            phaseType="2"></project-budget>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(6)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit7" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <t-form ref="form" :key="activeForm" v-if="activeForm === 8" labelAlign="top" class="step-form" :data="formData8"
            :rules="rules8"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）：" name="economicBenefits">
            <template #label>
              （一）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）：<span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
          </template>
            <tiny-mce-editor :key="activeForm"  :maxlength="site_tag==='jtt'?maxlength:maxlength*3" :textLength.sync="lengthLimitObj.economicBenefits"
                             v-model="formData8.economicBenefits"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(7)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit8" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>

    <!-- 其他问题 -->
    <t-form ref="form" :key="activeForm" v-if="activeForm === 9" labelAlign="top" class="step-form" :data="formData9"
            :rules="rules9"
            labelWidth="180px">
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）其它需要说明的问题（软科学类研究项目要列明预期成果报告的章节）：" name="otherProblems">
            <template #label>
              （一）其它需要说明的问题（软科学类研究项目要列明预期成果报告的章节）：<span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
          </template>
            <tiny-mce-editor :key="activeForm" :maxlength="site_tag==='jtt'?maxlength:maxlength*3" :textLength.sync="lengthLimitObj.otherProblems"
                             v-model="formData9.otherProblems"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(8)" theme="primary" variant="base">上一步</t-button>
          <t-button theme="primary" @click="onSubmit9" type="submit">下一步</t-button>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <t-form ref="form" :key="activeForm" v-if="activeForm === 10" labelAlign="top" class="step-form" :data="formData10"
            :rules="rules10"
            labelWidth="180px">
      <t-row v-if="isOldProject === '0'" style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="专家评审意见：" >
            <approve-list-by-review-type review-type="1" :obj-id="projectId"></approve-list-by-review-type>
          </t-form-item>
        </t-col>
      </t-row>
      <t-row style="align-items: stretch" :gutter="14">
        <t-col :span="12">
          <t-form-item label="（一）按专家评审意见修改说明" name="content">
            <template #label>
              <div v-if="site_tag === 'jt'">（一）按形式审查意见修改</div>
              <div v-else>
                （一）按立项专家评审意见修改说明：<span style="color: red">必须参照专家意见逐条回复</span><span class="textTips-color-red">如果遇到格式问题，请先将内容复制到word中调整好，再黏贴到系统中</span>
              </div>
            </template>
            <tiny-mce-editor :key="activeForm"  :textLength.sync="lengthLimitObj.profile"
                             v-model="formData10.content"></tiny-mce-editor>
          </t-form-item>
        </t-col>
      </t-row>

      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button @click="onCurChanged(9)" theme="primary" variant="base">上一步</t-button>
          <!-- <t-button v-if="isOldProject !== '1'" theme="primary"  @click="onSubmit10(1)">{{site_tag === 'jtt' ? '暂存' : '确认修改'}}</t-button>
          <t-tooltip v-if="isOldProject !== '1' && !['17'].includes(projectData.projectStatus)" content="提交后不可再编辑会进入审批流程">
            <t-button :disabled="isCommit" theme="primary" @click="onSubmit10(2)" type="submit">提交到单位管理员</t-button>
          </t-tooltip> -->
          <t-button theme="primary"  @click="onSubmit10(1)">暂存</t-button>

          <!-- <t-button theme="primary" @click="onSubmit10(2)" type="submit">下一步</t-button> -->
          <t-tooltip content="提交后不可再编辑会进入审批流程">
            <t-button theme="primary" @click="onSubmit10(2)" type="submit">提交</t-button>
          </t-tooltip>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </t-form>
    <!-- 附件信息 -->
    <div class="step-form" v-if="activeForm === 11">
      <t-row>
        <t-col :span="12">
          <t-table row-key="id" :columns="projectFileColumns" :data="projectFileData">
            <template #id="{row, rowIndex}">
              {{ rowIndex+1 }}
            </template>
            <template #op="{row}">
              <file-upload  tips="限制pdf、图片" accept="application/pdf,image/*" v-model="row.fileIds" :moduleKey="row.moduleKey"
                            :fileList="row.fileLists"
                            :multiple="true">
                <t-button variant="outline">
                  <t-icon name="cloud-upload" slot="icon"/>
                  点击上传
                </t-button>
              </file-upload>
            </template>
            <template #c1="{row}">
              <a v-if="row.c3" class="t-button-link" :href="`${file_domain}/${row.c3}`" target="_blank">{{ row.c1 }}</a>
              <div v-else>{{ row.c1 }}</div>
            </template>
          </t-table>
        </t-col>
      </t-row>
      <t-row>
        <t-col :span="11" class="query-form-inline">
          <t-button  type="reset" @click="onCurChanged(10)" theme="primary" variant="base">上一步
          </t-button>
          <t-tooltip content="提交后不可再编辑会进入报审流程">
          <t-button  theme="primary" :loading="loading" @click="onSubmit11" type="submit">{{ loading?'提交中': '提交' }}</t-button>
          </t-tooltip>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button variant="outline" @click="close">返回</t-button>
        </t-col>
      </t-row>
    </div>
  </div>
</template>

<script>
import { VITE_FILE_DOMAIN } from '@/api/upload'
import TinyMceEditor from "@/components/TinyMceEditor/index.vue";
import {TODAY} from '@/utils/date';
import ProjectBudget from '../pm/components/project-budget.vue'
import ProjectResearchPlan from '../pm/components/project-research-plan.vue'
import ProjectMember from '../pm/components/project-member.vue';
import ProjectUnit from '../pm/components/project-unit.vue';
import FileUpload from "@/components/FileUpload/index.vue"
import {getFiles} from "@/api/common";
import ProjectApproachExpectResults from "../pm/components/project-approach-expectResults.vue";
import ProjectDetailDialog from "../pm/components/project-detail-dialog.vue";
import ApproveList from "../approve/components/approve-list.vue";

import ProjectBackgroundLiterature from "../pm/components/project-background-literature.vue";
import approveListByReviewType from "../approve/components/approve-list-by-review-type.vue";
import dayjs from "dayjs";


export default {
  name: "project-outline",
  dicts: ["project_type", "subject_classification", "sys_user_sex", "prof_tit", "degree", "duty", "platform_type", "member_type", "recommend_type"],
  components: {
    TinyMceEditor,
    ProjectBudget,
    ProjectResearchPlan,
    ProjectMember,
    ProjectApproachExpectResults,
    ProjectUnit,
    FileUpload,
    ProjectDetailDialog,
    ProjectBackgroundLiterature,
    ApproveList,
    approveListByReviewType
  },
  data() {
    return {
      loading: false,
      file_domain: VITE_FILE_DOMAIN,
      site_tag: import.meta.env.VITE_SITE_TAG,
      projectFileData: [
        {
          id: 1,
          c1: "已盖章大纲",
          c2: "审批通过之后，走完盖章流程后上传。(当前阶段非必需)",
          fileIds: [],
          fileLists: [],
          moduleKey: "projectDG"
        }
      ],
      projectFileColumns: [
        {
          colKey: "id",
          title: "序号",
          align: "center",
          width: 64
        },
        {
          colKey: "c1",
          title: "附件名称",
          align: "center",
        },

        {
          colKey: "c2",
          title: "是否必需",
          align: "center",
        },
        {
          colKey: "op",
          title: "操作",
          align: "left",
        },
      ],
      applyLoading: false,
      activeForm: 0,
      maxlength: 2000,
      lengthLimitObj: {
        profile: 0,
        preliminaryWork: 0,
        unitOverview: 0,
        implementationPlan: 0,
        necessity: 0,
        economicBenefits: 0,
        otherProblems: 0
      },
      fundingObj: {subsidyFunding: 0, adviceFunding: 0},
      adviceFunding: 0,
      disableDate: {},
      dialog: {
        objId: null,
        open_project_detail: false,
        open_approve_list: false,
      },
      site_tag: import.meta.env.VITE_SITE_TAG,
      budgetForm: {},
      isCommit: false,
      projectId: null,
      taskId: null,
      formData0: {
        compileDate: TODAY,
        profile: '',
        projectNum: '',
        adviceFunding: null,
        subsidyFunding: null,
        projectName: '',
        startDate: '',
        endDate: '',
      },
      rules0: {
        projectName: [
          {
            required: true,
            message: "项目名称不能为空",
          },
        ],
        startDate: [
          {
            required: true,
            message: "项目开始时间不能为空",
          },
        ],
        endDate: [
          {
            required: true,
            message: "项目结束时间不能为空",
          },
          {
            validator: (val) => {
              if (val && this.formData0.startDate) {
                const startTime = new Date(this.formData0.startDate).getTime()
                const endTime = new Date(val).getTime()
                return startTime <= endTime;
              }
              return true;
            }, message: "项目开始时间不能大于结束时间", type: "error"
          },
        ],
        compileDate: [
          {
            required: true,
            message: "编制时间不能为空",
          },
        ],
        // projectNum: [
        //   {
        //     required: true,
        //     message: "项目编号不能为空",
        //   },
        // ],
        profile: [
          {
            required: true,
            message: "项目概要不能为空",
          },
        ],
        adviceFunding: [
          {
            required: true,
            message: "建议经费总概算不能为空",
          },
        ],
        subsidyFunding: [
          {
            required: true,
            message: "申请补助经费不能为空",
          },
        ],
        // economicIndex: [
        //   {
        //     required: true,
        //     message: "考核目标和技术经济指标不能为空",
        //   },
        // ],
        // unitOverview: [
        //   {
        //     required: true,
        //     message: "项目承担单位及合作单位概况不能为空",
        //   },
        // ],
      },
      rules00: {
        projectName: [
          {
            required: true,
            message: "项目名称不能为空",
          },
        ],
        startDate: [
          {
            required: true,
            message: "项目开始时间不能为空",
          },
        ],
        endDate: [
          {
            required: true,
            message: "项目结束时间不能为空",
          },
          {
            validator: (val) => {
              if (val && this.formData0.startDate) {
                const startTime = new Date(this.formData0.startDate).getTime()
                const endTime = new Date(val).getTime()
                return startTime <= endTime;
              }
              return true;
            }, message: "项目开始时间不能大于结束时间", type: "error"
          },
        ],
        compileDate: [
          {
            required: true,
            message: "编制时间不能为空",
          },
        ],
        projectNum: [
          {
            required: true,
            message: "项目编号不能为空",
          },
        ],
        profile: [
          {
            required: true,
            message: "项目概要不能为空",
          },
        ],
        adviceFunding: [
          {
            required: true,
            message: "建议经费总概算不能为空",
          },
        ],
        subsidyFunding: [
          {
            required: true,
            message: "申请补助经费不能为空",
          },
        ],
      },
      formData1: {
        preliminaryWork: '',
        literatures: [],
      },
      rules1: {
        preliminaryWork: [
          {
            required: true,
            message: "项目前期研究及工作基础不能为空",
          },
        ],
        literatures: [
          {required: true, validator: (val) => val && val.length, message: "主要参考文献不能为空", type: "error"}
        ]
      },
      formData2: {
        necessity: '',
      },
      rules2: {
        necessity: [
          {
            required: true,
            message: "项目研究、开发的背景、必要性不能为空",
          },
        ],
      },
      researchPlans: [],
      formData3: {
        implementationPlan: '',
        // economicBenefits: '',
        researchPlans: [],
        // projectExpectResults: [],
      },
      rules3: {
        // economicBenefits: [
        //   {
        //     required: true,
        //     message: "经济效益和社会效益评估不能为空",
        //   },
        // ],
        // projectExpectResults: [
        //   {required: true, validator: (val) => val.length > 0, message: "预期研究成果及表达形式不能为空", type: "error"}
        // ],
        implementationPlan: [
          {
            required: true,
            message: "项目研究、开发实施方案不能为空",
          },
        ],
        researchPlans: [
          {
            required: true,
            validator: (val) => val && val.length,
            message: "项目研究开发进度不能为空",
            type: "error",
          }
        ],
      },
      formData4:{
        goal: '',
        projectExpectResults: [],
      },
      rules4: {
        projectExpectResults: [
          {required: true, validator: (val) => val.length > 0, message: "预期研究成果及表达形式不能为空", type: "error"}
        ],
      },
      formData5: {
        // unitOverview: '',
        unitList: []
      },
      rules5: {},
      formData6: {
        memberList: []
      },
      rules6: {
        memberList: [
          {
            required: true,
            validator: (val) => val && val.length,
            message: "项目人员组成不能为空",
            type: "error",
          }
        ],
      },
      formData7: {
        budgetType: "1",
        phaseType: '2',
        inTbBudget: null,
        inZcBudget: null,
        inZcQtczbkBudget: null,
        inZcDwBudget: null,
        inZcQtBudget: null,
        outTbSbBudget: null,
        outZcSbBudget: null,
        outTbSzsbBudget: null,
        outZcSzsbBudget: null,
        outTbSbzzBudget: null,
        outZcSbzzBudget: null,
        outTbClBudget: null,
        outZcClBudget: null,
        outTbSyjgBudget: null,
        outZcSyjgBudget: null,
        outTbRldlBudget: null,
        outZcRldlBudget: null,
        outTbClvBudget: null,
        outZcClvBudget: null,
        outTbHyBudget: null,
        outTbGjhzBudget: null,
        outZcGjhzBudget: null,
        outTbCbBudget: null,
        outZcCbBudget: null,
        outTbLwBudget: null,
        outZcLwBudget: null,
        outTbZjzxBudget: null,
        outZcZjzxBudget: null,
        outTbQtBudget: null,
        outZcQtBudget: null,
        outTbGlBudget: null,
        outZcGlBudget: null,
        outTbJxzcBudget: null,
        outZcJxzcBudget: null,
        outZcHyBudget: null
      },
      rules7: {},
      formData8: {
        economicBenefits: '',
      },
      rules8: {
        economicBenefits: [
          {
            required: true,
            message: "经济效益和社会效益评估不能为空",
          },
        ],
      },
      formData10:{
        projectId: null,
        outlineId: null,
        content: '',
      },
      rules10:{
        content: [
          {
            required: true,
            message: "按专家评审意见修改说明不能为空",
          },
        ],
      },
      formData9: {
        otherProblems: ''
      },
      rules9: {
        otherProblems: [
          {
            required: true,
            message: "其它需要说明的问题不能为空",
          },
        ],
      },
      dictTypes: {},
      isOldProject: '0',
      startDate: '',
      endDate: '',
      projectData: {}
    }
  },
  watch: {
    activeForm: {
      immediate: true,
      handler(val) {
        const targetEle = document.getElementById("main")
        if (targetEle) {
          const {pos, top} = targetEle.style;
          targetEle.style.position = 'relative';
          targetEle.style.top = '-100px';
          targetEle.scrollIntoView({behavior: 'smooth', block: 'start', inline: "nearest"});
          targetEle.style.top = top;
          targetEle.style.position = pos;
        }
      }
    }
  },
  async created() {
    this.isOldProject = this.$route.query.isOldProject || '0';
    const projectId = this.$route.params && this.$route.params.taskId;
    if (!projectId) {
      this.$message.error("缺少项目id");
      return false;
    }

    // 获取编制时间
    this.$api.kjxm.outline.getSubmitTime(projectId).then(res => {
      this.startDate = res.data.startDate;
      this.endDate = res.data.endDate;
    }).catch((e) => {
      this.$message.error(e.toString());
    });

    this.projectId = projectId;
    this.dialog.objId = projectId;
    this.taskId = projectId;
    const activeForm = Number(sessionStorage.getItem(`${this.taskId}-outline-activeForm`)) || 0;
    // this.activeForm = activeForm;
    // 获取项目详情
    this.applyLoading = true;
    this.$api.kjxm.project.get(Number(this.projectId)).then(pro => {
      this.projectData = pro.data;
      this.disableDate = {
        before: dayjs(pro.data.startDate, "YYYY-MM-DD").endOf('month').subtract(1, 'month').format(),
        // after: dayjs(pro.data.endDate, "YYYY-MM-DD").endOf('month').subtract(0, 'month').format(),
      }
      this.fundingObj = {
        adviceFunding: pro.data.adviceFunding,
        subsidyFunding: pro.data.subsidyFunding
      }
      this.adviceFunding = pro.data.adviceFunding;
      this.formData0.adviceFunding = pro.data.adviceFunding;
      this.formData0.subsidyFunding = pro.data.subsidyFunding;
      this.formData0.startDate = pro.data.startDate;
      this.formData0.endDate = pro.data.endDate;
      this.formData0.projectName = pro.data.projectName;
      this.onCurChanged(activeForm, 0);
    }).catch((e) => {
      this.applyLoading = false;
      this.$message.error(e.toString());
    });
  },
  beforeDestroy() {
    this.applyLoading = false;
  },
  methods: {
    handlerOpenDetail(val){
      if(val.item.label==='申报详情'){
        this.dialog.open_project_detail = true;
      }else if(val.item.label === '评审记录'){
        this.dialog.open_approve_list = true;
      }
    },
    onCurChanged(cur, pre) {
      if(Number(cur) !== 0){
        if (!sessionStorage.getItem(`${this.taskId}-outline-outlineId`)) {
          this.applyLoading = false;
          this.$message.error("基本信息还未提交")
          return false;
        }
      }
      this.applyLoading = true;
      // 根据不同的activeForm 复查数据
      if (Number(cur) === 0) {
        if (sessionStorage.getItem(`${this.taskId}-outlineId`)) {
          const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
          this.$api.kjxm.outline.get(outlineId).then(response => {
            if (response.data) {
              // 为null剔除 使用项目的
              if (response.data.subsidyFunding === null) {
                delete response.data.subsidyFunding;
              }
              if (response.data.adviceFunding === null) {
                delete response.data.adviceFunding;
              }
              if ([null,''].includes(response.data.startDate)) {
                delete response.data.startDate;
              }
              if ([null,''].includes(response.data.endDate)) {
                delete response.data.endDate;
              }
              if ([null,''].includes(response.data.projectName)) {
                delete response.data.projectName;
              }
              Object.assign(this.formData0, response.data)
              Object.assign(this.fundingObj, response.data)
            }
            this.activeForm = cur;
            sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
            this.applyLoading = false;
          }).catch((e) => {
            this.applyLoading = false;
            this.$message.error(e.toString());
          });
        } else {
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }
      } else if (Number(cur) === 1) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlinePreWorkGetById(outlineId).then(response => {
          if (response.data) {
            Object.assign(this.formData1, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      } else if (Number(cur) === 2) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlineNecessityGetById(outlineId).then(response => {
          if (response.data) {
            Object.assign(this.formData2, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      } else if (Number(cur) === 3) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlineImplPlanGetById(outlineId).then(response => {
          if (response.data) {
            if (Object.prototype.hasOwnProperty.call(response.data, "researchPlans")) {
              delete response.data.researchPlans;
            }
            Object.assign(this.formData3, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      } else if (Number(cur) === 4) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlineGoalGetByOutlineId(outlineId).then(response => {
          if (response.data) {
            Object.assign(this.formData4, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      } else if (Number(cur) === 5) {
        // this.activeForm = cur;
        // sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
        // this.applyLoading = false;
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.get(outlineId).then(response => {
          if (response.data) {
            if (response.data.adviceFunding === null) {
              delete response.data.adviceFunding;
            }else {
              this.adviceFunding = response.data.adviceFunding;
            }
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      }
      else if (Number(cur) === 6) {
        this.activeForm = cur;
        sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
        this.applyLoading = false;
      }
      else if (Number(cur) === 7) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.get(outlineId).then(response => {
          if (response.data) {
            // 为null剔除 使用项目的
            if (response.data.subsidyFunding === null) {
              delete response.data.subsidyFunding;
            }
            if (response.data.adviceFunding === null) {
              delete response.data.adviceFunding;
            }
            Object.assign(this.fundingObj, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      }else if (Number(cur) === 8) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlineBenefitsGetByOutlineId(outlineId).then(response => {
          if (response.data) {
            Object.assign(this.formData8, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      }
      else if (Number(cur) === 9) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlineOtherGetById(outlineId).then(response => {
          if (response.data) {
            Object.assign(this.formData9, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      }
      else if (Number(cur) === 10) {
        const outlineId = Number(sessionStorage.getItem(`${this.taskId}-outlineId`));
        this.$api.kjxm.outline.projectOutlineExplainGetByOutlineId(outlineId).then(response => {
          if (response.data) {
            Object.assign(this.formData10, response.data)
          }
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      } else if (Number(cur) === 11) {
        getFiles(this.taskId).then((res) => {
          const files = {}
          res.data.forEach((item) => {
            if (!files[item.moduleKey]) {
              files[item.moduleKey] = []
            }
            files[item.moduleKey].push({
              name: item.fileName,
              url: item.fullFilePath,
              id: item.id,
              filePath: item.filePath
            })
          })
          const fileLists = []
          this.projectFileData.forEach((val,index)=>{
            this.projectFileData[index].fileLists = files[val.moduleKey] || [];
            this.projectFileData[index].fileIds = files[val.moduleKey]?.map(val => val.id) || [];
            fileLists.push(...this.projectFileData[index].fileIds)
          })
          if (fileLists.length > 0) {
            sessionStorage.setItem(`${this.taskId}-outline-fileId`, res.data.length)
          }
          // this.projectFileData[0].fileLists = files.projectDG || [];
          // this.projectFileData[0].fileIds = files.projectDG?.map(val => val.id) || [];
          // const fileLists = []
          this.activeForm = cur;
          sessionStorage.setItem(`${this.taskId}-outline-activeForm`, cur);
          this.applyLoading = false;
        }).catch((e) => {
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      }
    },
    isSubmit(name) {
      if(sessionStorage.getItem(`${this.taskId}-outline-${name}`)){
        return '已提交'
      }
      return '未提交';
    },
    isSubmitStatus(name) {
      return !!sessionStorage.getItem(`${this.taskId}-outline-${name}`);
    },
    close() {
      this.applyLoading = false;
      setTimeout(() => {
        this.$tab.closeOpenPage({path: "/kjxm/outline/project-my"});
      }, 1000)
    },
    onSubmit0() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          if (Number(this.formData0.adviceFunding) < Number(this.formData0.subsidyFunding)) {
            const label = this.site_tag === 'jtt' ? '申请厅补助经费' : '申请集团补助经费';
            this.$message.error(`建议经费总概算:${this.formData0.adviceFunding}不能小于${label}:${this.formData0.subsidyFunding}`);
            return false
          }
          if(this.site_tag === 'jtt'){
            if (this.lengthLimitObj.profile > this.maxlength) {
              this.$message.error(`（一）项目概要：： 当前字数：${this.lengthLimitObj.profile}，限制字数：${this.maxlength}`)
              return false;
            }
          }else if (this.lengthLimitObj.profile > this.maxlength*3) {
            this.$message.error(`（一）项目概要：： 当前字数：${this.lengthLimitObj.profile}，限制字数：${this.maxlength*3}`)
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-outlineId`)) {
            this.$api.kjxm.outline.add({
              ...this.formData0,
              // outlineStatus: this.isOldProject === '1'?null:'1',
              projectId: this.projectId,
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-outlineId`, response.data.id)
              sessionStorage.setItem(`${this.taskId}-outlineId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(1)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.outline.update({
              ...this.formData0,
              // outlineStatus: this.isOldProject === '1'?null:'1',
              projectId: this.projectId,
              id: sessionStorage.getItem(`${this.taskId}-outline-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(1)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
        }
      });
    },
    onSubmit1() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          if(this.site_tag === 'jtt'){
            if (this.lengthLimitObj.preliminaryWork > this.maxlength) {
              this.$message.error(`（一）项目前期研究及工作基础（包括国内外同类技术研究现状分析及评价，应附主要参考文献及出处）： 当前字数：${this.lengthLimitObj.preliminaryWork}，限制字数：${this.maxlength}`)
              return false;
            }
          }else if (this.lengthLimitObj.preliminaryWork > this.maxlength*3) {
            this.$message.error(`（一）项目前期研究及工作基础（包括国内外同类技术研究现状分析及评价，应附主要参考文献及出处）： 当前字数：${this.lengthLimitObj.preliminaryWork}，限制字数：${this.maxlength*3}`)
            return false;
          }
          // 校验论文内容
          const isValidate = this.$refs["project-background-literature"].checkData();
          if (!isValidate) {
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-basicstudyId`)) {
            this.$api.kjxm.outline.projectOutlinePreWorkAdd({
              ...this.formData1,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-basicstudyId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(2)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.outline.projectOutlinePreWorkUpdate({
              ...this.formData1,
              id: sessionStorage.getItem(`${this.taskId}-outline-basicstudyId`),
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(2)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
        }
      });
    },
    onSubmit2() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          if(this.site_tag === 'jtt'){
            if (this.lengthLimitObj.necessity > this.maxlength) {
              this.$message.error(`（一）项目研究、开发的背景、必要性（包括项目研究目的，市场需求前景或推广应用领域，达到的技术水平及在国民经济发展中的作用等）：当前字数：${this.lengthLimitObj.necessity}，限制字数：${this.maxlength}`)
              return false;
            }
          }else if (this.lengthLimitObj.necessity > this.maxlength*3) {
            this.$message.error(`（一）项目研究、开发的背景、必要性（包括项目研究目的，市场需求前景或推广应用领域，达到的技术水平及在国民经济发展中的作用等）：当前字数：${this.lengthLimitObj.necessity}，限制字数：${this.maxlength*3}`)
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-backgroundId`)) {
            this.$api.kjxm.outline.projectOutlineNecessityAdd({
              ...this.formData2,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-backgroundId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(3)
            }).catch((e) => {
              this.$message.error(e.toString());
              this.applyLoading = false
            });
          } else {
            this.$api.kjxm.outline.projectOutlineNecessityUpdate({
              ...this.formData2,
              id: sessionStorage.getItem(`${this.taskId}-outline-backgroundId`),
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(3)
            }).catch((e) => {
              this.$message.error(e.toString());
              this.applyLoading = false
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
        }
      });
    },
    onSubmit3() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          if(this.site_tag === 'jtt'){
            if (this.lengthLimitObj.implementationPlan > 4000) {
              this.$message.error(`（一）项目研究、开发实施方案（包括拟解决的关键问题，实施的具体内容及实施方案，拟采取的技术路线等）：当前字数：${this.lengthLimitObj.implementationPlan}，限制字数：4000`)
              return false;
            }
          }else if (this.lengthLimitObj.implementationPlan > 4000*3) {
            this.$message.error(`（一）项目研究、开发实施方案（包括拟解决的关键问题，实施的具体内容及实施方案，拟采取的技术路线等）：当前字数：${this.lengthLimitObj.implementationPlan}，限制字数：12000`)
            return false;
          }

          // if (this.lengthLimitObj.economicBenefits > this.maxlength) {
          //   this.$message.error(`（四）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）：当前字数：${this.lengthLimitObj.economicBenefits}，限制字数：${this.maxlength}`)
          //   return false;
          // }
          // 年度研究计划 非空判断
          const isValidate = this.$refs["project-research-plan"].checkData()
          if (!isValidate) {
            return false;
          }
          // const isValidate2 = this.$refs["project-approach-expect-results"].checkData()
          // if (!isValidate2) {
          //   return false;
          // }
          const projectResearchPlan = this.formData3.researchPlans.map((row, index) => ({
            ...row,
            startDate: row.startDate,
            endDate: row.endDate,
            content: row.content,
            sort: index + 1,
            // projectId: row.projectId,
            // phaseType: row.phaseType,
          }))
          this.formData3.researchPlans = projectResearchPlan
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-approachId`)) {
            this.$api.kjxm.outline.projectOutlineImplPlanAdd({
              ...this.formData3,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-approachId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(4)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.outline.projectOutlineImplPlanUpdate({
              ...this.formData3,
              id: sessionStorage.getItem(`${this.taskId}-outline-approachId`),
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(4)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
          this.applyLoading = false;
        }
      });
    },
    onSubmit4() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          const isValidate2 = this.$refs["project-approach-expect-results"].checkData()
          if (!isValidate2) {
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-goalId`)) {
            this.$api.kjxm.outline.projectOutlineGoalAdd({
              ...this.formData4,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-goalId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(5)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.outline.projectOutlineGoalUpdate({
              ...this.formData4,
              id: sessionStorage.getItem(`${this.taskId}-outline-goalId`),
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(5)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
          this.applyLoading = false;
        }
      });
    },
    onSubmit5() {
      const isValidate = this.$refs["project-unit"].checkData()
      if (!isValidate) {
        return false;
      }
      this.applyLoading = true;
      this.formData5.unitList = this.formData5.unitList.map(val => ({...val}))
      this.$api.kjxm.project.companyAdd(this.formData5.unitList).then(response => {
        this.$message.success('提交成功');
        sessionStorage.setItem(`${this.taskId}-outline-companyId`, this.formData5.unitList.length)
        this.onCurChanged(6)
      }).catch((e) => {
        this.applyLoading = false;
        this.$message.error(e.toString());
      });
    },
    onSubmit6() {
      // 需要判断必填
      const data1 = this.formData6.memberList.filter((val) => ['1', '2'].includes(val.type));
      const data2 = this.formData6.memberList.filter((val) => val.type === '3');
      if (data1.length <= 0) {
        this.$message.error('项目负责人不能为空');
        return
      }
      this.formData6.memberList = this.formData6.memberList.map(val => ({...val}))

      this.applyLoading = true;
      this.$api.kjxm.project.memberAdd(this.formData6.memberList).then(response => {
        this.$message.success('提交成功');
        sessionStorage.setItem(`${this.taskId}-outline-memberId`, this.formData6.memberList.length)
        this.onCurChanged(7)
      }).catch((e) => {
        this.applyLoading = false;
        this.$message.error(e.toString());
      });
    },
    onSubmit7() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          // 判断经费来源 经费支出 是否一致
          const sum1 = (Number(((this.formData7.inTbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.inZcBudget || 0)*100).toFixed(2))) / 100;
          const sum2 = (Number(((this.formData7.outTbSbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbSzsbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbSbzzBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbClBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbSyjgBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbRldlBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbClvBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbHyBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbGjhzBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbCbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbLwBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbZjzxBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbQtBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outTbGlBudget || 0)*100).toFixed(2))  + Number(((this.formData7.outTbJxzcBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcSbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcSzsbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcSbzzBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcClBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcSyjgBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcRldlBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcClvBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcHyBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcGjhzBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcCbBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcLwBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcZjzxBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcQtBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcGlBudget || 0)*100).toFixed(2)) + Number(((this.formData7.outZcJxzcBudget || 0)*100).toFixed(2))) / 100;
          if (sum1 !== sum2) {
            this.$message.error('经费来源与经费支出金额不一致');
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-budgetId`)) {
            this.$api.kjxm.project.budgetAdd({
              ...this.formData7,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-budgetId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(8)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.project.budgetEdit({
              ...this.formData7,
              id: sessionStorage.getItem(`${this.taskId}-outline-budgetId`),
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(8)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
        }
      });
    },
    onSubmit8() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          if(this.site_tag === 'jtt'){
            if (this.lengthLimitObj.economicBenefits > this.maxlength) {
              this.$message.error(`（一）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）：当前字数：${this.lengthLimitObj.economicBenefits}，限制字数：${this.maxlength}`)
              return false;
            }
          }else if (this.lengthLimitObj.economicBenefits > this.maxlength*3) {
            this.$message.error(`（一）经济效益和社会效益评估（包括提供主要分析指标及演算公式，市场占有率，形成的生产能力，利税、创汇或有关节约工程造价等）：当前字数：${this.lengthLimitObj.economicBenefits}，限制字数：${this.maxlength*3}`)
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-benefitId`)) {
            this.$api.kjxm.outline.projectOutlineBenefitsAdd({
              ...this.formData8,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-benefitId`, response.data.id)
              this.$message.success('提交成功');
              this.onCurChanged(9)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.outline.projectOutlineBenefitsUpdate({
              ...this.formData8,
              id: sessionStorage.getItem(`${this.taskId}-outline-benefitId`),
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(9)
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
          this.applyLoading = false;
        }
      });
    },
    onSubmit9() {
      this.$refs.form.validate().then((validateResult) => {
        if (validateResult === true) {
          if(this.site_tag === 'jtt'){
            if (this.lengthLimitObj.otherProblems > this.maxlength) {
              this.$message.error(`（一）其它需要说明的问题（软科学类研究项目要列明预期成果报告的章节）：当前字数：${this.lengthLimitObj.otherProblems}，限制字数：${this.maxlength}`)
              return false;
            }
          }else if (this.lengthLimitObj.otherProblems > this.maxlength*3) {
            this.$message.error(`（一）其它需要说明的问题（软科学类研究项目要列明预期成果报告的章节）：当前字数：${this.lengthLimitObj.otherProblems}，限制字数：${this.maxlength*3}`)
            return false;
          }
          this.applyLoading = true;
          if (!sessionStorage.getItem(`${this.taskId}-outline-otherId`)) {
            this.$api.kjxm.outline.projectOutlineOtherAdd({
              ...this.formData9,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
            }).then(response => {
              sessionStorage.setItem(`${this.taskId}-outline-otherId`, response.data.id);
              this.$message.success('提交成功');
              this.onCurChanged(10);
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          } else {
            this.$api.kjxm.outline.projectOutlineOtherUpdate({
              ...this.formData9,
              projectId: this.projectId,
              outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`),
              id: sessionStorage.getItem(`${this.taskId}-outline-otherId`),
            }).then(response => {
              this.$message.success('提交成功');
              this.onCurChanged(10);
            }).catch((e) => {
              this.applyLoading = false;
              this.$message.error(e.toString());
            });
          }
        } else {
          const firstError = Object.values(validateResult)[0]?.[0]?.message;
          this.$message.error(firstError);
        }
      });
    },
    onSubmit10(type) {
      if(type === 1){
        this.applyLoading = true;
        if (!sessionStorage.getItem(`${this.taskId}-outline-reviewId`)) {
          this.$api.kjxm.outline.projectOutlineExplainAdd({
            ...this.formData10,
            projectId: this.projectId,
            outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
          }).then(response => {
            sessionStorage.setItem(`${this.taskId}-outline-reviewId`, response.data.id)
            this.$message.success("暂存成功");
            this.applyLoading = false;
          }).catch((e) => {
            this.applyLoading = false;
            this.$message.error(e.toString());
          });
        } else {
          this.$api.kjxm.outline.projectOutlineExplainUpdate({
            ...this.formData10,
            projectId: this.projectId,
            outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`),
            id:sessionStorage.getItem(`${this.taskId}-outline-reviewId`),
          }).then(response => {
            this.applyLoading = false;
            this.$message.success("暂存成功");
          }).catch((e) => {
            this.applyLoading = false;
            this.$message.error(e.toString());
          });
        }
      }else{
        //提交
        const confirmDia = this.$dialog.confirm({
          header: "提示",
          body: `提交后不可再编辑会进入审批流程，是否确认提交？`,
          theme: "warning",
          onConfirm: ({e}) => {
            confirmDia.update({
              confirmBtn: {
                loading: true,
              },
            })
            this.$refs.form.validate().then((validateResult) => {
              if (validateResult === true) {
                if(this.isOldProject !== '1'){
                  // 判断所有步骤是否是提交不是则提示错误
                  if (!sessionStorage.getItem(`${this.taskId}-outline-outlineId`)) {
                    this.$message.error("基本信息还未提交")
                    this.applyLoading = false;
                    return false;
                  }
                  if (!sessionStorage.getItem(`${this.taskId}-outline-basicstudyId`)) {
                    this.$message.error("前期研究及工作基础还未提交")
                    this.applyLoading = false;
                    return false;
                  }

                  if (!sessionStorage.getItem(`${this.taskId}-outline-backgroundId`)) {
                    this.$message.error("研究、开发的背景、必要性还未提交");
                    this.applyLoading = false;
                    return false;
                  }

                  if (!sessionStorage.getItem(`${this.taskId}-outline-approachId`)) {
                    this.$message.error("研究、开发实施方案还未提交");
                    this.applyLoading = false;
                    return false;
                  }
                  if (!sessionStorage.getItem(`${this.taskId}-outline-goalId`)) {
                    this.$message.error("考核目标和技术经济指标");
                    this.applyLoading = false;
                    return false;
                  }
                  if (!sessionStorage.getItem(`${this.taskId}-outline-companyId`)) {
                    this.$message.error("单位信息还未提交");
                    this.applyLoading = false;
                    return false;
                  }

                  if (!sessionStorage.getItem(`${this.taskId}-outline-memberId`)) {
                    this.$message.error("研究人员还未提交");
                    this.applyLoading = false;
                    return false;
                  }

                  if (!sessionStorage.getItem(`${this.taskId}-outline-budgetId`)) {
                    this.$message.error("经费预算还未提交");
                    this.applyLoading = false;
                    return false;
                  }
                  if (!sessionStorage.getItem(`${this.taskId}-outline-benefitId`)) {
                    this.$message.error("经济效益和社会效益评估还未提交");
                    this.applyLoading = false;
                    return false;
                  }
                  if (!sessionStorage.getItem(`${this.taskId}-outline-otherId`)) {
                    this.$message.error("其他需要说明的问题还未提交");
                    this.applyLoading = false;
                    return false;
                  }
                  // if (!sessionStorage.getItem(`${this.taskId}-outline-reviewId`)) {
                  //   this.$message.error("按专家评审意见修改说明还未提交");
                  //   this.applyLoading = false;
                  //   return false;
                  // }
                }
                this.isCommit = true;
                this.applyLoading = true;
                if (!sessionStorage.getItem(`${this.taskId}-outline-reviewId`)) {
                  this.$api.kjxm.outline.projectOutlineExplainAdd({
                    ...this.formData10,
                    projectId: this.projectId,
                    outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
                  }).then(response => {
                    sessionStorage.setItem(`${this.taskId}-outline-reviewId`, response.data.id)
                    // this.$message.success('提交成功');
                    // this.onCurChanged(8)
                    if(this.isOldProject === '1'){
                      this.$message.success('提交成功');
                      this.onCurChanged(11)
                    }else {
                      this.$api.kjxm.outline.submit({
                        projectId: this.projectId,
                        id: sessionStorage.getItem(`${this.taskId}-outlineId`)
                      }).then(response => {
                        this.$message.success('提交成功');
                        this.applyLoading = false;
                        this.close();
                      }).catch((e) => {
                        this.isCommit = false;
                        this.applyLoading = false;
                        this.$message.error(e.toString());
                      });
                    }
                  }).catch((e) => {
                    this.isCommit = false;
                    this.applyLoading = false;
                    this.$message.error(e.toString());
                  });
                } else {
                  this.$api.kjxm.outline.projectOutlineExplainUpdate({
                    ...this.formData10,
                    id: sessionStorage.getItem(`${this.taskId}-outline-reviewId`),
                    projectId: this.projectId,
                    outlineId: sessionStorage.getItem(`${this.taskId}-outlineId`)
                  }).then(response => {
                    if(this.isOldProject === '1'){
                      this.$message.success('提交成功');
                      this.onCurChanged(11)
                    }else{
                      this.$api.kjxm.outline.submit({
                        projectId: this.projectId,
                        id: sessionStorage.getItem(`${this.taskId}-outlineId`)
                      }).then(response => {
                        this.$message.success('提交成功');
                        this.applyLoading = false;
                        this.close();
                      }).catch((e) => {
                        this.isCommit = false;
                        this.applyLoading = false;
                        this.$message.error(e.toString());
                      });
                    }
                  }).catch((e) => {
                    this.isCommit = false;
                    this.applyLoading = false;
                    this.$message.error(e.toString());
                  });
                }
              } else {
                const firstError = Object.values(validateResult)[0]?.[0]?.message;
                this.$message.error(firstError);
              }
              confirmDia.destroy();
            });
          },
          onClose: ({ e, trigger }) => {
            confirmDia.hide();
          },
        });
      }
    },
    onSubmit11() {
      // if (this.projectFileData[0].fileIds.length <= 0) {
      //   this.$message.error("需要上传已盖章大纲");
      //   return false;
      // }
      // 判断所有步骤是否是提交不是则提示错误
      if (!sessionStorage.getItem(`${this.taskId}-outline-outlineId`)) {
        this.$message.error("基本信息还未提交")
        this.applyLoading = false;
        return false;
      }
      if (!sessionStorage.getItem(`${this.taskId}-outline-basicstudyId`)) {
        this.$message.error("前期研究及工作基础还未提交")
        this.applyLoading = false;
        return false;
      }

      if (!sessionStorage.getItem(`${this.taskId}-outline-backgroundId`)) {
        this.$message.error("研究、开发的背景、必要性还未提交");
        this.applyLoading = false;
        return false;
      }

      if (!sessionStorage.getItem(`${this.taskId}-outline-approachId`)) {
        this.$message.error("研究、开发实施方案还未提交");
        this.applyLoading = false;
        return false;
      }
      if (!sessionStorage.getItem(`${this.taskId}-outline-goalId`)) {
        this.$message.error("考核目标和技术经济指标");
        this.applyLoading = false;
        return false;
      }
      if (!sessionStorage.getItem(`${this.taskId}-outline-companyId`)) {
        this.$message.error("单位信息还未提交");
        this.applyLoading = false;
        return false;
      }

      if (!sessionStorage.getItem(`${this.taskId}-outline-memberId`)) {
        this.$message.error("研究人员还未提交");
        this.applyLoading = false;
        return false;
      }

      if (!sessionStorage.getItem(`${this.taskId}-outline-budgetId`)) {
        this.$message.error("经费预算还未提交");
        this.applyLoading = false;
        return false;
      }
      if (!sessionStorage.getItem(`${this.taskId}-outline-benefitId`)) {
        this.$message.error("经济效益和社会效益评估还未提交");
        this.applyLoading = false;
        return false;
      }
      if (!sessionStorage.getItem(`${this.taskId}-outline-otherId`)) {
        this.$message.error("其他需要说明的问题还未提交");
        this.applyLoading = false;
        return false;
      }
      if (!sessionStorage.getItem(`${this.taskId}-outline-reviewId`)) {
        this.$message.error("按专家评审意见修改说明还未提交");
        this.applyLoading = false;
        return false;
      }

      this.loading = true;
      const sysAttMainIds = []
      this.projectFileData.forEach(val=>{
        sysAttMainIds.push(...val.fileIds)
      })
      this.applyLoading = true;
      this.$api.kjxm.project.edit({
        id: this.projectId,
        sysAttMainVo: {
          sysAttMainIds
        }
      }).then(response => {
        sessionStorage.setItem(`${this.taskId}-outline-fileId`, '1')
        this.$api.kjxm.outline.submit({
          projectId: this.projectId,
          id: sessionStorage.getItem(`${this.taskId}-outlineId`)
        }).then(response => {
          this.$message.success('提交成功');
          this.applyLoading = false;
          this.close();
        }).catch((e) => {
          this.loading = false;
          this.applyLoading = false;
          this.$message.error(e.toString());
        });
      }).catch((e) => {
        this.loading = false;
        this.applyLoading = false;
        this.$message.error(e.toString());
      });
    },
  }
}
</script>

<style lang="less" scoped>
.step-form {
  padding: 0 24px;
}

.t-row {
  margin-bottom: 14px;
}

.step-card {
  height: 100%;
  margin-bottom: 14px;
}
</style>
